<?php

namespace App\Http\Controllers\admin\validate;

use Illuminate\Support\Facades\Validator;

class WhiteApp
{

    public static function whiteAppList($param){
        $rules = [
            'userId'=>'required',
            'startSize'=>'required',
            'pageSize'=>'required',
            
        ];
        $msg = [
            'userId.required'=>'用户编号不能为空',
            'startSize.required'=>'当前页不能为空',
            'pageSize.required'=>'页面显示数不能为空',
            
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function whiteAppAdd($param){
        $rules = [
            'userId'=>'required|numeric',
            'type'=>'required|numeric',
            'group'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
            'type.required'=>'类型为空',
            'type.numeric'=>'类型格式不对',
            'group.required'=>'group为空',
            'group.numeric'=>'group格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function whiteAppById($param){
        $rules = [
            'id'=>'required|numeric',
        ];
        $msg = [
            'id.required'=>'编号为空',
            'id.numeric'=>'编号格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function whiteAppEdit($param){
        $rules = [
            'userId'=>'required|numeric',
            'id'=>'required|numeric',
            'type'=>'required|numeric',
            'group'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
            'id.required'=>'编号为空',
            'id.numeric'=>'编号格式不对',
            'type.required'=>'类型为空',
            'type.numeric'=>'类型格式不对',
            'group.required'=>'group为空',
            'group.numeric'=>'group格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function whiteAppDelete($param){
        $rules = [
            'userId'=>'required|numeric',
            'id'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
            'id.required'=>'编号为空',
            'id.numeric'=>'编号格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

}
